package com.deer.wms.ASN.manage.model.in;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.deer.wms.project.root.annotaiton.MyAnnotation;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

/**
 * @Author: xu
 * @Date: 2022/10/11/14:25
 * @Description:
 */
@Data
public class AcceptRecordExcel {
    private static final long serialVersionUID = -5835640530808832030L;
    /**
     * ID
     */

    @Column(name = "id")
    @TableId(type = IdType.AUTO)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 收货单编码
     */
    private String acceptRecordCode;

    /**
     * 仓库ID
     */
    @Column(name = "ware_id")
    private Integer wareId;

    /**
     * 仓库
     */
    private String wareName;

    /**
     * 货主ID
     */
    private Integer organizationId;

    /**
     * 货主
     */
    private String organizationName;

    /**
     * 物料编码
     */
    @MyAnnotation(columnIndex = 0, columnName = "物料编码")
    private String itemCode;

    /**
     * 物料名称
     */
    @MyAnnotation(columnIndex = 1, columnName = "物料名称")
    private String itemName;

    /**
     * 规格
     */
    private String spec;

    /**
     * 型号
     */
    private String model;

    /**
     * 物料照片URL
     */
    private String imgUrl;

    /**
     * 批次ID
     */
    @Column(name = "batch_id")
    private Integer batchId;

    /**
     * 批次
     */
    @Column(name = "batch_name")
    @MyAnnotation(columnIndex = 2, columnName = "批号")
    private String batchName;

    /**
     * 箱号
     */
    @Column(name = "box_code")
    private String boxCode;

    /**
     * 收货库位
     */
    @Column(name = "cell_code")
    private String cellCode;

    /**
     * 包装ID
     */
    @Column(name = "pack_detail_id")
    private Integer packDetailId;

    /**
     * 包装描述
     */
    @Column(name = "pack_describe")
    private String packDescribe;

    /**
     * 计划数量
     */
    private Double expectQuantity;

    /**
     * 收货数量
     */
    private Double quantity;

    /**
     * 已装箱数量
     */
    private Double packedQuantity;

    /**
     * 合格数量--如皋
     */
    @MyAnnotation(columnIndex = 5, columnName = "合格数量")
    private Double qualifiedQuantity;

    public Double getQualifiedQuantity() {
        return ObjectUtil.isNotEmpty(qualifiedQuantity) ? qualifiedQuantity : 0.00D;
    }

    /**
     * 不合格数量--如皋
     */
    private Double unqualifiedQuantity;

    public Double getUnqualifiedQuantity() {
        return ObjectUtil.isNotEmpty(unqualifiedQuantity) ? unqualifiedQuantity : 0.00D;
    }

    /**
     * 单据类型
     */
    private Integer billType;

    /**
     * 备注
     */
    @MyAnnotation(columnIndex = 9, columnName = "备注")
    private String memo;

    /**
     * ASN单号
     */
    @MyAnnotation(columnIndex = 3, columnName = "任务单号")
    private String asnBillNo;

    /**
     * ASN详情单号
     */
    private String asnDetailNo;

    /**
     * 运单号
     */
    private String shipBillNo;

    /**
     * 采购详情单号
     */
    private String requestDetailDetailNo;

    /**
     * 计划包装ID
     */
    private Integer expectPackDetailId;

    /**
     * 计划包装
     */
    private String expectPackDescribe;

    /**
     * 转换率
     */
    private Double transRatio;

    /**
     * 计划转换率
     */
    private Double expectTransRatio;

    /**
     * 库存ID
     */
    private Integer inventoryId;

    /**
     * 状态 0-新建 2-已确认
     */
    private Integer state;

    /**
     * 质检状态  0-免检  1-待检  2-已检
     */
    private Integer qcState;

    /**
     * 异常ID
     */
    private Integer acceptExId;

    /**
     * 收货人ID
     */
    @Column(name = "accept_user_id")
    private Integer acceptUserId;

    /**
     * 收货人
     */
    @Column(name = "accept_user_name")
    @MyAnnotation(columnIndex = 4, columnName = "收货人")
    private String acceptUserName;

    /**
     * 收货时间
     */
    @MyAnnotation(columnIndex = 6, columnName = "收货时间")

    private String acceptTime;

    private String isTransmit;//是否传输

    private String version;

    private String latestVersion;

    private Integer asnStockId;
    private String asnStockName;
    @TableField(exist = false)
    private Integer categoryId;

    //数量
    @TableField(exist = false)
    private Double qty;

    /**
     * 质检数量
     */
    private Double qcQuantity;

    //上架人userId
    private Integer upUserId;
    //上架人userName
    private String upUserName;


    //装箱数量
    @TableField(exist = false)
    @ApiModelProperty("装箱数量")
    private Double pcs;

    @TableField(exist = false)
    private Integer sort;

    @TableField(exist = false)
    private String agreementNo;

    @TableField(exist = false)
    private String mtoNo;

    @TableField(exist = false)
    @MyAnnotation(columnIndex = 7, columnName = "上架人")
    private String confirmUserName;
    @TableField(exist = false)
    @MyAnnotation(columnIndex = 8, columnName = "上架库位")
    private String toCellCode;
    @TableField(exist = false)
    private String toBoxCode;
    @TableField(exist = false)
    private String confirmUserId;

    @MyAnnotation(columnIndex = 8, columnName = "供应商")
    private String supplierName;
}
